import {createApp} from "vue";
import MessageBox from "./MessageBox.vue";

MessageBox.alert = (message)=>{
    const msgBox = createApp(MessageBox, {message})
    const container = document.createElement('div')
    document.body.append(container)
    msgBox.mount(container)
    setTimeout(()=>{
        msgBox.unmount()
        container.remove()
    },2000)
}

export const showErrorMessage = (e) =>{
    MessageBox.alert(e.toString())
    console.log(e)
}